// 查询列表接口
const getCategoryPage = (params) => {
  return $axios({
    url: '/daily',
    method: 'get',
    params
  })
}

const findByConditionJS = (params) => {
  if (params.dateValue !== null){
    let date = new Date(params.dateValue);
    params.dateValue = date.toDateString();
  }
  return $axios({
    url: '/daily',
    method: 'get',
    params
  })
}



// 发送邮件提醒
const sendEmailInfo = (params) => {
  return $axios({
    url: '/daily/info',
    method: 'get',
    params
  })
}

// 查询今日谁没交接口
// 返回数据格式：
/*{
	"code": 1,
	"msg": null,
	"data": [
		{
			"id": "88",
			"title": null,
			"content": null,
			"file": null,
			"planId": null,
			"belongTime": 1705680000000,
			"code": 0,
			"userId": "1",
			"user": {
				"id": "1",
				"name": "林昊宇",
				"role": "学生",
				"email": "1756065426@qq.com"
			}
		}
	],
	"map": {}
}*/
const listNoSubDaily = (params)=>{
  return $axios({
    url: "/daily/nosub",
    method: 'get',
    params
  })
}









// 查询今日日报内容
const listContentDaily = (params)=>{
  return $axios({
    url: "/daily/content",
    method: 'get',
    params
  })
}

// 编辑页面反查详情接口
const queryCategoryById = (id) => {
  return $axios({
    url: `/category/${id}`,
    method: 'get'
  })
}

// 删除当前列的接口
const deleCategory = (id) => {
  return $axios({
    url: '/category',
    method: 'delete',
    params: { id }
  })
}

// 修改接口
const editCategory = (params) => {
  return $axios({
    url: '/category',
    method: 'put',
    data: { ...params }
  })
}

// 新增接口
const addCategory = (params) => {

  return $axios({
    url: '/category',
    method: 'post',
    data: { ...params }
  })
}
function getCount() {
  return $axios({
    url: '/home/count',
    method: 'get',
  }).then(response => {
    // 从响应中获取数值并更新Vue实例的数据
    return response;
  }).catch(error => {
    // 处理错误
    console.error('请求失败：', error);
  });
}

